﻿using System;
using System.IO;
using System.Text;

   class ReplaceStartEnd
    {
        static void Main(string[] args)
        {
            StreamReader firstFile = new StreamReader("testFile.txt");
            StreamWriter replacedFile = new StreamWriter("replacedWords.txt", false, Encoding.GetEncoding("UTF-8"));
            using (firstFile)
            {
                using (replacedFile)
                {
                   string line = firstFile.ReadLine();
                   while (line != null)
                   {
                       string newLine = line.Replace("start", "end");
                       replacedFile.WriteLine(newLine);
                       line = firstFile.ReadLine();
                       Console.WriteLine(newLine);
                       
                   }
                   
                }
            }
        }
    }
